package cn.csdj.sism.service.impl;

import cn.csdj.sism.dao.PaymentTypeMapper;
import cn.csdj.sism.pojo.PaymentType;
import cn.csdj.sism.service.PaymentService;
import cn.csdj.sism.service.PaymentTypeService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author 李加
 * 2023/4/10
 */
@Service
public class PaymentTypeServiceImpl implements PaymentTypeService {
    @Autowired
    private PaymentTypeMapper paymentTypeMapper;
    @Override
    public List<PaymentType> selectPmtAll() {
        return paymentTypeMapper.selectList(null);
    }

    @Override
    public PaymentType selectPmtById(Integer id) {
        return paymentTypeMapper.selectById(id);
    }

    @Override
    public int insertPmt(PaymentType paymentType) {
        return paymentTypeMapper.insert(paymentType);
    }

    @Override
    public int updatePmt(PaymentType paymentType) {
        return paymentTypeMapper.updateById(paymentType);
    }

    @Override
    public int delectPmtById(Integer id) {
        return paymentTypeMapper.deleteById(id);
    }

    @Override
    public IPage<PaymentType> page(Integer current,Integer PageSize) {
        IPage<PaymentType> page=new Page(current,PageSize);
        paymentTypeMapper.selectPage(page,null);
        return page;
    }
}
